/**
 * @author:linjiye
 * @date: 2024/12/25
 * @desc:
 **/

import {StyleSheet, Text, View} from 'react-native'
import React, {useEffect, useState} from 'react'
import PageFormBtn from "@/components/PageFormBtn";
import UseExplosiveWrap from "@/components/useExplosive/UseExplosiveWrap";
import PageScrollView from "@/components/PageScrollView";
import {useRouter} from "expo-router";
import {useSelector} from "react-redux";

type Props = {}

const index = (props: Props) => {
    const [params, setParams] = useState({})
    const router = useRouter();
    const p = useSelector(state => state.useExplosive.params)

    useEffect(() => {
        if(p) setParams(p)
    }, [p]);

    const handlePageFormBtnClick = (val) => {
        router.navigate(`/aiOriginality/result?fromWay=useExplosivePage`)
    }

    return (
        <PageScrollView
            isHaveHeader
            isTransparentTab
            pageBottom = {
                <PageFormBtn disable={!params.profitModelId} btnName='生成文案' onPageFormBtnClick={handlePageFormBtnClick}/>
            }
        >
            <UseExplosiveWrap />
        </PageScrollView>
    )
}

export default index

const styles = StyleSheet.create({
    
})